﻿// -------------------------------------------------------------------------
//    @FileName         :    NFCommDefine.h
//    @Author           :    gaoyi
//    @Date             :    24-8-14
//    @Email            :    445267987@qq.com
//    @Module           :    NFCommDefine
//
// -------------------------------------------------------------------------

#pragma once

#include "NFComm/NFCore/NFPlatform.h"
#include "NFComm/NFObjCommon/NFObject.h"

#ifdef NF_DEBUG_MODE
#define GAMESVR_MAX_PLAYER_NUM_IN_HASH_TABLE 9991
#define OBSVR_MAX_BATTLE_IN_HASH            1000
#define MATCHSVR_MAX_ROLE              1024
#define GUILDSVR_MAX_ROLESIM_NUM_IN_HASH_TABLE 1000
#define SNSSVR_MAX_GUILD_NUM_IN_HASH_TABLE 2000
#define MAX_WORLD_PLAYER_NUM 5000//�����������
#define SNSSVR_MAX_ONLINE_ROLE_NUM_IN_HASH_TABLE  10000
#define SNSSVR_MAX_ROLESIMPLE_NUM_IN_HASH_TABLE  5000
#define SNSSVR_MAX_ROLE_IN_FAMILY_HASH_TABLE  20000
#define SNSSVR_MAX_FAMILY_COUNT  1000
#define SNSSVR_MAX_FRIEND_NUM_IN_HASH_TABLE  200
#define MAX_TREASURE_GOODS_NUM				1000
//#define SNSSVR_MAX_GUILDWAR_NUM			12
#define MAX_MATH_PLAYER_IN_POOL         128
const int MAX_TEAM_NUM=200;
#define SNSSVR_ROLESIMPLE_SAVE_TIME 3000
#define SNSSVR_ROLEMAIL_SAVE_TIME 1200
#define MAX_SNS_MAIL_HASH_NUM 500
#define MAX_SNS_MAIL_RELEASE_NUM 50
#else
#define GAMESVR_MAX_PLAYER_NUM_IN_HASH_TABLE 19991
#define OBSVR_MAX_BATTLE_IN_HASH            10000
#define MATCHSVR_MAX_ROLE           16*1024
#define GUILDSVR_MAX_ROLESIM_NUM_IN_HASH_TABLE 200000
#define SNSSVR_MAX_GUILD_NUM_IN_HASH_TABLE 2000
#define MAX_WORLD_PLAYER_NUM 50000
const int MAX_TEAM_NUM=2000;
#define SNSSVR_MAX_ONLINE_ROLE_NUM_IN_HASH_TABLE  10000
#define SNSSVR_MAX_ROLESIMPLE_NUM_IN_HASH_TABLE  50000
#define SNSSVR_MAX_ROLE_IN_FAMILY_HASH_TABLE  20000
#define SNSSVR_MAX_FAMILY_COUNT  1000
#define SNSSVR_MAX_FRIEND_NUM_IN_HASH_TABLE  10000000
#define MAX_TREASURE_GOODS_NUM				10000
//#define SNSSVR_MAX_GUILDWAR_NUM			48
#define MAX_MATH_PLAYER_IN_POOL         2048
#define SNSSVR_ROLESIMPLE_SAVE_TIME 1000
#define SNSSVR_ROLEMAIL_SAVE_TIME 1200
#define MAX_SNS_MAIL_HASH_NUM 5000
#define MAX_SNS_MAIL_RELEASE_NUM 500
#endif

#define MAX_PLAYER_ACCOUNT_SIZE  128
#define MAX_ACCOUNT_OPEN_ID_SIZE 128
#define MAX_ACCESSTOKEN_SIZE 128

struct tagAccountAndID
{
    tagAccountAndID()
    {
        if (EN_OBJ_MODE_INIT == NFShmMgr::Instance()->GetCreateMode())
        {
            CreateInit();
        }
        else
        {
            ResumeInit();
        }
    }

    int CreateInit()
    {
        m_ullUid = 0;
        m_iZoneID = 0;
        return 0;
    }

    int ResumeInit()
    {
        return 0;
    }

    bool operator==(const tagAccountAndID &data) const
    {
        return m_ullUid == data.m_ullUid && m_iZoneID == data.m_iZoneID;
    }

    uint64_t m_ullUid;
    int m_iZoneID;
};

namespace std
{
    template<>
    struct hash<tagAccountAndID>
    {
        size_t operator()(const tagAccountAndID &data) const
        {
            return NFHash::hash_combine(data.m_ullUid, data.m_iZoneID);
        }
    };
}